NOTE: This Technical Q&A has been retired. Please see the Technical Q&As page for current documentation. |
![]() ![]() |
Q: I am trying to shade a 3D landscape using Trigrids, but I can't get this to work, and the examples in the documentation are not very helpful. The landscapes look fine as wire frames, but when I turn on shading, I just get one continuous gray blob. If I try to use a more advanced shading technique (e.g., pixmap), my application crashes. A: Try setting up a surface shader (either Phong or Lambert). Assuming you are holding your displayable objects in a display group or an ordered group, you can do this in the following way:
Alternatively, you can create a shader object, and draw it before any of your geometries in your submit procedure. Remember that if you are using a plain display group, the shader object must be the first object placed in the group, or all the objects that are put in the group before the shader will be flat-shaded (this does not apply to ordered display groups). The latest samples, libraries, and headers are available on the Developer CD. See also Apple's QuickDraw 3D home page for the most current 3D development information. |
Developer Documentation | Technical Notes | Development Kits | Sample Code |